package cn.cdu.medical.controller;

import cn.cdu.basics.baseVo.Result;
import cn.cdu.medical.entity.PrescriptionDetail;
import cn.cdu.medical.service.IPrescriptionDetailService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
//  import io.swagger.v3.oas.annotations.Parameter;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import io.swagger.v3.oas.annotations.Parameter;
import java.util.List;

/**
 * 处方明细控制器
 */
@Tag(name = "处方明细接口")
@RestController
@RequestMapping("/zwz/prescription-detail")
@RequiredArgsConstructor
public class PrescriptionDetailController {
    
    private final IPrescriptionDetailService prescriptionDetailService;
    
    @Operation(summary = "根据就诊记录ID查询处方明细")
    @GetMapping("/list")
    public Result<List<PrescriptionDetail>> getPrescriptionDetails(
            @Parameter(description = "就诊记录ID") @RequestParam String medicalRecordId) {
        List<PrescriptionDetail> details = prescriptionDetailService.getByMedicalRecordId(medicalRecordId);
        return Result.success(details);
    }
} 